<!--
 * @Author: libaihao 22857108132qq.com
 * @Date: 2022-09-29 16:43:30
 * @LastEditors: libaihao 22857108132qq.com
 * @LastEditTime: 2022-11-08 08:48:16
 * @FilePath: \vue02 - 副本\src\views\Home.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    
        <el-container style=" border: 1px solid #eee">
          <el-header style="background-color: #031528;display: flex;align-items: center;
      justify-content: space-between">
        <div style="font-family: 华文行楷;font-size: 30px;color: #e4e7ed;">浪荡大头鬼</div>
      <div style="height: 60px;">
          <el-dropdown @command="handleCmd" >
              <span class="el-dropdown-link" style="display: flex;align-items: center;cursor: pointer;font-size: 15px;margin-right: 10px;">
            <img style="width: 48px;height: 48px;border-radius: 10px;margin-right: 5px;" src="https://wx2.sinaimg.cn/mw2000/50861ae8ly1h71qt55s6kj20u0140n6p.jpg" alt=""/>
                <i></i>
              </span>
              <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="setting">系统设置(暂无)</el-dropdown-item>
              <el-dropdown-item command="usercenter">个人中心(暂无)</el-dropdown-item>
              <el-dropdown-item command="logout" divided>注销登录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
      </div>
      </el-header>
        
    <el-container>
  <el-aside style="width:200px;">
    <el-menu router :default-active="this.$router.path" style="background-color: rgb(235, 238, 245);">
      <el-menu-item index="homepage" >
        <template slot="title" ><i class="el-icon-message"></i>首页</template>
      </el-menu-item>

      <el-menu-item index="/banner">
        <template slot="title"><i class="el-icon-menu"></i>Banner管理</template>
      </el-menu-item>

      <el-menu-item index="/user">
        <template slot="title"><i class="el-icon-user"></i>用户管理</template>
      </el-menu-item>

      <el-menu-item index="/merchant">
        <template slot="title"><i class="el-icon-office-building"></i>商户管理</template>
      </el-menu-item>

      <el-menu-item index="/order">
        <template slot="title"><i class="el-icon-shopping-cart-1"></i>订单管理</template>
      </el-menu-item>

      <el-menu-item index="/class">
        <template slot="title"><i class="el-icon-notebook-1"></i>课程管理</template>
      </el-menu-item>
      
      <el-menu-item index="/finance">
        <template slot="title"><i class="el-icon-magic-stick"></i>财务中心</template>
      </el-menu-item>

      <el-menu-item index="/admin">
        <template slot="title"><i class="el-icon-s-tools"></i>管理员设置</template>
          <!-- <el-menu-item index="/role" style="background-color: #e4e7ed ;">角色管理</el-menu-item>
          <el-menu-item index="/emp" style="background-color: #e4e7ed ">员工管理</el-menu-item>
          <el-menu-item index="/authority" style="background-color: #e4e7ed ">权限分配</el-menu-item> -->
      </el-menu-item>

    </el-menu>
  </el-aside>
  

    
    
    <el-main style="background-color: #ebeef5;">
     <router-view/>
    </el-main>

</el-container>
</el-container>

    </div>
</template>

<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>

<script>


  export default {
    data() {
      return {
        
      }
      
    },
    computed: {
     
    },
    methods:{
      handleCmd(cmd) {
      if (cmd == 'logout') {
        //注销登录
        this.$confirm('是否注销登录?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          //执行注销登录
          this.getRequest("/loginout");
          //删除sessionStorage 中的数据
          window.sessionStorage.removeItem("user");
          //跳转到项目登录页面
          this.$router.replace("/");
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });
        });
      }
    }
    }
    
  };
</script>